<template>
  <div class="dashboard-editor-container">
    <div class="clearfix">
      <pan-thumb :image="userInfo.image.url" style="float: left">
        <span class="pan-info-roles">您当前的角色为</span>
        <h2 class="pan-info-roles" :style="{color: theme}">{{ userInfo.role.name }}</h2>
      </pan-thumb>
      <div class="info-container">
        <span class="display_name">欢迎您 {{ userInfo.nickname }}</span>
        <span class="blessing">祝您工作愉快 O(∩_∩)O</span>
      </div>
    </div>
    <div>
      <img :src="emptyGif" class="emptyGif">
    </div>
  </div>
</template>

<script>
import { mapGetters } from 'vuex'
import PanThumb from '@/components/PanThumb'

export default {
  name: 'Dashboard',
  components: { PanThumb },
  computed: {
    ...mapGetters(['userInfo', 'theme'])
  },
  data() {
    return {
      emptyGif: 'https://wpimg.wallstcn.com/0e03b7da-db9e-4819-ba10-9016ddfdaed3'
    }
  },
}
</script>

<style lang="scss" scoped>
.emptyGif {
  display: block;
  width: 45%;
  margin: 0 auto;
}

.dashboard-editor-container {
  background-color: #e3e3e3;
  min-height: 100vh;
  padding: 50px 60px 0px;
  span.pan-info-roles {
    margin-top: 10px;
    font-size: 14px;
    font-weight: 700;
    color: #333;
    display: block;
  }
  h2.pan-info-roles {
    color: #fff;
    position: relative;
    letter-spacing: 2px;
    font-size: 22px;
    font-family: 'Open Sans', Arial, sans-serif;
    text-shadow: 0 0 1px #fff, 0 1px 2px rgba(0, 0, 0, 0.3);
  }
  .info-container {
    position: relative;
    margin-left: 190px;
    height: 150px;
    line-height: 200px;
    .display_name {
      font-size: 48px;
      line-height: 48px;
      color: #212121;
      position: absolute;
      top: 25px;
    }
    .blessing {
      font-size: 20px;
      padding-top: 20px;
      display: inline-block;
    }
  }
}
</style>
